﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

//资源管理器。加载方式和使用逻辑分离。
//以便于支持：热更新,对象池
public class ResMgr :Singleton<ResMgr>
{

    public GameObject GetInstance(string resPath)
    {
        return GameObject.Instantiate(Resources.Load<GameObject>(resPath));
    }
    public GameObject GetInstance(string resPath, Transform parent)
    {
        return GameObject.Instantiate(Resources.Load<GameObject>(resPath), parent);
    }
    public GameObject GetInstance(string resPath, Transform parent, bool worldPositionStays)
    {
        return GameObject.Instantiate(Resources.Load<GameObject>(resPath),parent,worldPositionStays);
    }

}
